package com.mydomain.Bodega;

import com.mydomain.Bodega.*;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("invAjusteItemHome")
public class InvAjusteItemHome extends EntityHome<InvAjusteItem> {

	@In(create = true)
	InvAjusteHome invAjusteHome;
	@In(create = true)
	InvItemStockHome invItemStockHome;

	public void setInvAjusteItemAjuCodigoItem(String id) {
		setId(id);
	}

	public String getInvAjusteItemAjuCodigoItem() {
		return (String) getId();
	}

	@Override
	protected InvAjusteItem createInstance() {
		InvAjusteItem invAjusteItem = new InvAjusteItem();
		return invAjusteItem;
	}

	public void wire() {
		getInstance();
		InvAjuste invAjuste = invAjusteHome.getDefinedInstance();
		if (invAjuste != null) {
			getInstance().setInvAjuste(invAjuste);
		}
		InvItemStock invItemStock = invItemStockHome.getDefinedInstance();
		if (invItemStock != null) {
			getInstance().setInvItemStock(invItemStock);
		}
	}

	public boolean isWired() {
		return true;
	}

	public InvAjusteItem getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

}
